package com.jxust.vhr.controller;

import com.jxust.vhr.service.TestService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author tyeerth
 * @date 2020/10/12 - 19:25
 */
@RestController
@RequestMapping("/admin")
public class TestController1 {
    @Resource
    private TestService testService;
    @RequestMapping("hello1")
    public String testhello(){
        return "admin 9091端口";
    }

    @ApiOperation(value = "计算+", notes = "加法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "a", paramType = "path", value = "数字a", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "b", paramType = "path", value = "数字b", required = true, dataType = "Long")
    })
    @GetMapping("/{a}/{b}")
    public Integer get(@PathVariable Integer a, @PathVariable Integer b) {
        return a + b;
    }

    @RequestMapping("/TestDao")
    public void TestDao(){
        testService.TestDao();
    }

}
